Rebuild derived memories a delete left stale [Cloud-only]
curl --request POST \
--url https://api.evermind.ai/api/v2/memory/rebuild \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "default",
"project_id": "default",
"user_id": "<string>",
"agent_id": "<string>",
"targets": [],
"force": false,
"dry_run": false
}
'import requests
url = "https://api.evermind.ai/api/v2/memory/rebuild"
payload = {
"app_id": "default",
"project_id": "default",
"user_id": "<string>",
"agent_id": "<string>",
"targets": [],
"force": False,
"dry_run": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
app_id: 'default',
project_id: 'default',
user_id: '<string>',
agent_id: '<string>',
targets: [],
force: false,
dry_run: false
})
};
fetch('https://api.evermind.ai/api/v2/memory/rebuild', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.evermind.ai/api/v2/memory/rebuild",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'app_id' => 'default',
'project_id' => 'default',
'user_id' => '<string>',
'agent_id' => '<string>',
'targets' => [
],
'force' => false,
'dry_run' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.evermind.ai/api/v2/memory/rebuild"
payload := strings.NewReader("{\n \"app_id\": \"default\",\n \"project_id\": \"default\",\n \"user_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"targets\": [],\n \"force\": false,\n \"dry_run\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.evermind.ai/api/v2/memory/rebuild")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"app_id\": \"default\",\n \"project_id\": \"default\",\n \"user_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"targets\": [],\n \"force\": false,\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evermind.ai/api/v2/memory/rebuild")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"app_id\": \"default\",\n \"project_id\": \"default\",\n \"user_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"targets\": [],\n \"force\": false,\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"status": "queued",
"job_id": "<string>",
"targets": [
"profile"
],
"estimated_episodes": 0
}
}{}{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{}{}Rebuild
Rebuild derived memories a delete left stale [Cloud-only]
Regenerate the derived memories that deletes left stale.
A delete never spends LLM calls. Derived memories that only an LLM can regenerate (the user profile, session summaries, agent skills) are kept and marked stale instead: the delete response has rebuild_required and targets, and the profile has stale. This call starts one background job that regenerates them from the remaining memories. Nothing is regenerated until you call it, so batch your deletes first.
- Pass
user_id(profile, session summaries) oragent_id(skills).targetsnarrows the rebuild; by default everything marked stale is rebuilt. dry_runreports what would be rebuilt (estimated_episodessizes a profile rebuild) and spends nothing.forcerebuilds the profile or skills even when nothing is marked; an owner with no profile yet has none to rebuild.- One job per owner at a time: a second call returns the running job with
status: already_running. - The call is free; the extraction it runs is metered like any extraction, so it is refused with 429 once the account’s usage quota is exhausted.
While a profile rebuild runs, the profile holds only its manually edited items plus what has been re-extracted so far, and stale stays true until the job finishes. Poll /api/v2/memory/rebuild/status with the returned job_id.
POST
/
api
/
v2
/
memory
/
rebuild
Rebuild derived memories a delete left stale [Cloud-only]
curl --request POST \
--url https://api.evermind.ai/api/v2/memory/rebuild \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "default",
"project_id": "default",
"user_id": "<string>",
"agent_id": "<string>",
"targets": [],
"force": false,
"dry_run": false
}
'import requests
url = "https://api.evermind.ai/api/v2/memory/rebuild"
payload = {
"app_id": "default",
"project_id": "default",
"user_id": "<string>",
"agent_id": "<string>",
"targets": [],
"force": False,
"dry_run": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
app_id: 'default',
project_id: 'default',
user_id: '<string>',
agent_id: '<string>',
targets: [],
force: false,
dry_run: false
})
};
fetch('https://api.evermind.ai/api/v2/memory/rebuild', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.evermind.ai/api/v2/memory/rebuild",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'app_id' => 'default',
'project_id' => 'default',
'user_id' => '<string>',
'agent_id' => '<string>',
'targets' => [
],
'force' => false,
'dry_run' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.evermind.ai/api/v2/memory/rebuild"
payload := strings.NewReader("{\n \"app_id\": \"default\",\n \"project_id\": \"default\",\n \"user_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"targets\": [],\n \"force\": false,\n \"dry_run\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.evermind.ai/api/v2/memory/rebuild")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"app_id\": \"default\",\n \"project_id\": \"default\",\n \"user_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"targets\": [],\n \"force\": false,\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evermind.ai/api/v2/memory/rebuild")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"app_id\": \"default\",\n \"project_id\": \"default\",\n \"user_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"targets\": [],\n \"force\": false,\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"status": "queued",
"job_id": "<string>",
"targets": [
"profile"
],
"estimated_episodes": 0
}
}{}{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{}{}Authorizations
Body
application/json
Was this page helpful?

